/**   
* @{#} FuncNode.java Create on 2013-8-12 上午8:28:30   
*   
* Copyright (c) 2012 by Baidu.   
*/
package objtable.engine.xmlnode;

import java.util.List;

import objtable.engine.ExeNode;
import objtable.engine.XmlEngine;
import objtable.engine.xmlnode.gen.Dbpara;
import objtable.engine.xmlnode.gen.Dbparas;
import objtable.port.DbPort;

/**   
* @author <a href="mailto:zhangbo07@baidu.com">zhangbo07</a>  
* @version 1.0   
*/
public class DbparasNode extends ExeNode {
	private Dbparas dbparas;

	public Dbparas getDbparas() {
		return dbparas;
	}

	public void setDbparas(Dbparas dbparas) {
		this.dbparas = dbparas;
	}

	@Override
	public void exeNode() {
		List<Dbpara> ls = dbparas.getDbpara();
		for (Dbpara p : ls) {
			DbPort port = (DbPort) XmlEngine.getObjById(p.getDbid());
			String value = port.oneValueQuery(p.getSql()).toString();
			XmlEngine.putDbparas(p.getName(), value);
		}
	}
}
